Skip to content

Conversation

@ArcaneNibble
Copy link
Collaborator

As mentioned on the call earlier today, I decided to test if this module was already working or not. It would appear that it is, at least for basic distance measurements. I don't have a remote or any way to test the other functionality,

@coveralls
Copy link

coveralls commented Jul 17, 2025

Coverage Status

coverage: 57.239%. remained the same
when pulling 1970ca2 on ArcaneNibble:ev3-ir
into 4484552 on pybricks:master.

Copy link
Member

@dlech dlech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If they compile, I would expect the gyro and ultrasonic sensor to work as well since they are also UART sensors.

This compiles, and IR distance measurement appears to be working correctly.

Ultrasonic sensors and gyro have not been manually tested but are expected
to work as they share the common UART protocol handling.
@ArcaneNibble
Copy link
Collaborator Author

I've enabled all the ev3devices sensors in the build, since they do indeed all compile.

@ArcaneNibble ArcaneNibble changed the title pybricks/ev3devices: Enable InfraredSensor support pybricks/ev3devices: Enable remaining device support Jul 18, 2025
extern const mp_obj_type_t pb_type_ev3devices_InfraredSensor;
extern const mp_obj_type_t pb_type_ev3devices_GyroSensor;
extern const mp_obj_type_t pb_type_ev3devices_UltrasonicSensor;
extern const mp_obj_type_t pb_type_ev3devices_GyroSensor;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why changing the order?

@laurensvalk
Copy link
Member

These haven't been updated to the async API yet, so they haven't been enabled yet. I'll see if I can get around to the InfraredSensor soon so you have something to test with 🤖

The gyro sensor needs some work too. I've already enabled the necessary quirks at the protocol level, but haven't exposed them yet. It's on my list 🙂 Thanks!

@laurensvalk
Copy link
Member

For now you can do:

>>> dev = PUPDevice(Port.S2)
>>> dev.read(0)[0]
42

@BertLindeman
Copy link
Contributor

Have flashed (curious as I am) on the EV3:
ev3-firmware-build-4001-git03f0414a

Tried 3 sensors.

  1. The NXT Sensor, Ultrasonic, NXT
    53792
    did not work with us = UltrasonicSensor(Port.S2)
    and also not with us = PUPDevice(Port.S2)
    Both ENODEV.

  2. The EV3 Sensor, Ultrasonic, EV3
    95652
    works, both as UltrasonicSensor and PUPDevice.

  3. The EV3 IR sensor Sensor, Infrared, EV3
    95654
    works with PUPDevice (did not check values) and IRSensor.

@laurensvalk
Copy link
Member

Thanks Bert. We'll get there pretty soon! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants